package com.zzu.view.fragment;

import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.zzu.R;
import com.zzu.view.activity.LoginActivity;
import com.zzu.view.activity.MyLocationActivity;
import com.zzu.view.activity.UpdateActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @description:
 * @author: bytedance
 * @date: 2021-05-07 23:35
 * 我的Fragment
 */
public class FragmentFour extends BaseFragment implements View.OnClickListener {

    private final String TAG = FragmentZero.class.getSimpleName();

    @BindView(R.id.tv_four_position)
    TextView tvFourPosition;
    @BindView(R.id.tv_four_update)
    TextView tvFourUpdate;
    @BindView(R.id.tv_four_exit)
    TextView tvFourExit;
    @BindView(R.id.tv_four_qita)
    TextView tvFourQita;

    @Override
    public View initView() {
        Log.e(TAG, "我的视图被初始化了");
        View view = View.inflate(mContext, R.layout.fragment_four, null);
        ButterKnife.bind(this,view);
        //添加监听事件
        initListener();
        return view;
    }



    @Override
    public void initData() {
        super.initData();
        Log.e(TAG, "我的数据被初始化了");
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_four_position:
                //显示我的位置
                startActivity(new Intent(mContext, MyLocationActivity.class));
                break;
            case R.id.tv_four_update:
                //修改个人信息
                startActivity(new Intent(mContext, UpdateActivity.class));
                break;
            case R.id.tv_four_exit:
                //退出登陆
                getActivity().finish();
                Intent intent = new Intent(mContext, LoginActivity.class);
                startActivity(intent);
                break;
            case R.id.tv_four_qita:
                //其他功能
                break;
            default:
                break;
        }

    }

    private void initListener() {
        tvFourPosition.setOnClickListener(this);
        tvFourUpdate.setOnClickListener(this);
        tvFourExit.setOnClickListener(this);
        tvFourQita.setOnClickListener(this);
    }



}
